var phpmyCreateXhrTab = function (label, url) {
    var tab =  new YAHOO.widget.Tab({
        label: label,
        dataSrc: url,
        cacheData: true
    });
    var onDataLoadedChange = function (obj, event) {
        var o = { responseText: event.newValue};
        phpmyhandleSuccess(o);
        // extract tabview content
        var json = o.responseText.substring(o.responseText.indexOf('{'), o.responseText.lastIndexOf('}') + 1);
        var data;
        if(json){
            data = eval('(' + json + ')');
            if (data.Results.tabViewContent){
                obj.set('content', data.Results.tabViewContent);
            }
        }
        if (event.prevValue == event.newValue) return true;
        return false;
    };
    tab.addListener('beforeContentChange', function (e) { return onDataLoadedChange(tab, e); });
    return tab;
};
var phpmyCreateTab = function (label, content) {
    var tab =  new YAHOO.widget.Tab({
        label: label,
        content: content
    });
    return tab;
};